Databases today rely on three components. First, an in-memory (e.g., a random access memory (RAM), a cache) buffer pool stores pages that are currently being accessed and/or modified by active transactions. Second, possibly out-of-date versions of the pages in memory are stored in a media that persist the entire contents of the database. Finally, a log of modifications to pages is kept to ensure that modifications made to the database are not lost in the event of a failure of a component of the database.
Thus, when a transaction attempts to access and/or modify a database entry that is not already in the buffer pool, a page in which the database entry resides is fetched from the media to the buffer pool, where the transaction (e.g., via a processor) operates on the database entry. When modifications are made to a page and/or database entry, these modifications are written to the log before the modification is stored in the media by writing the page back to the media or applying the modification to the page on the media. For example, if a modified page is removed from the buffer pool because it is no longer needed in memory or when the space in the buffer pool is needed for other pages, then the modifications are first made to the log before the modified page is written back to the media. These techniques are generally referred to as write-ahead logging.